// import { getToken } from "../utils/localData";
import request from "../utils/request";
//request==axios

export const userloginAPI = (data) => request({
    method: 'POST',
    url: '/login',
    data
})
//注册
export const userRegisterAPI = (data) => request({
    method: 'POST',
    url: '/register',
    data
})
//用户详情
export const getUserInfoAPI = (id) => request({
    method: 'GET',
    url: `/user/${id}`,
    // 用户详情接口需要验证，把本地存储的 token 值带上
    // headers: {
    //     Authorization: getToken()
    // }

})

// 编辑用户信息
export const userUpdateByIdAPI = (id, data) => request({
    method: 'POST',
    url: `/user_update/${id}`,
    // 用户详情接口需要验证，把本地存储的 token 值带上
    // headers: {
    //     Authorization: getToken()
    // },
    data: data
})

//关注用户
export const userFollowsByIdAPI = (id) => request({
    url: `/user_follows/${id}`,//id是作者的id
})

//取消关注用户
export const userUnfollowByIdAPI = (id) => request({
    url: `/user_unfollow/${id}`,//id是作者的id
})
//关注列表
export const user_FollowsByIdAPI = () => request({
    url: `/user_follows`,
})
//获取收藏列表
export const getUserStar = () => request({
    url: `/user_star`,
})
//获取用户评论列表
export const getUserComments = () => request({
    url: '/user_comments',
})